package com.example.rabbitmq.demo1_delay;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @Author songyahui
 * @Date 2023/7/12 8:31
 * @Description
 */
@Slf4j
@Component
public class DeadLetterConsumer {

    @RabbitListener(queues = "QD")
    public void receiveD(Message message){
        String msg = new String(message.getBody());
        log.info("当前时间{}，收到死信队列的消息：{}", new Date(), msg);
    }
}

